The present invention relates generally to methods and apparatus for processing of audio signals, and specifically to methods for estimating the pitch of a speech signal.
Speech sounds are produced by modulating air flow in the speech tract. Voiceless sounds originate from turbulent noise created at a constriction somewhere in the vocal tract, while voiced sounds are excited in the larynx by periodic vibrations of the vocal cords. Roughly speaking, the variable period of the laryngeal vibrations gives rise to the pitch of the speech sounds. Low-bit-rate speech coding schemes typically separate the modulation from the speech source (voiced or unvoiced), and code these two elements separately. In order to enable the speech to be properly reconstructed, it is necessary to accurately estimate the pitch of the voiced parts of the speech at the time of coding. A variety of techniques have been developed for this purpose, including both time- and frequency-domain methods. A number of these techniques are surveyed by Hess in Pitch Determination of Speech Signals (Springer-Verlag, 1983), which is incorporated herein by reference.
The Fourier transform of a periodic signal, such as voiced speech, has the form of a train of impulses, or peaks, in the frequency domain. This impulse train corresponds to the line spectrum of the signal, which can be represented as a sequence {(ai, xcex8i)}, wherein xcex8i are the frequencies of the peaks, and ai are the respective complex-valued line spectral amplitudes. To determine whether a given segment of a speech signal is voiced or unvoiced, and to calculate the pitch if the segment is voiced, the time-domain signal is first multiplied by a finite smooth window. The Fourier transform of the windowed signal is then given by:                               X          ⁡                      (            θ            )                          =                              ∑            k                    ⁢                                    a              k                        ⁢                          W              ⁡                              (                                  θ                  -                                      θ                    k                                                  )                                                                        (        1        )            
wherein W(xcex8) is the Fourier transform of the window.
Given any pitch frequency, the line spectrum corresponding to that pitch frequency could contain line spectral components at all multiples of that frequency. It therefore follows that any frequency appearing in the line spectrum may be a multiple of a number of different candidate pitch frequencies. Consequently, for any peak appearing in the transformed signal, there will be a sequence of candidate pitch frequencies that could give rise to that particular peak, wherein each of the candidate frequencies is an integer dividend of the frequency of the peak. This ambiguity is present whether the spectrum is analyzed in the frequency domain, or whether it is transformed back to the time domain for further analysis.
Frequency-domain pitch estimation is typically based on analyzing the locations and amplitudes of the peaks in the transformed signal X(xcex8). For example, a method based on correlating the spectrum with the xe2x80x9cteethxe2x80x9d of a prototypical spectral comb is described by Martin in an article entitled xe2x80x9cComparison of Pitch Detection by Cepstrum and Spectral Comb Analysis,xe2x80x9d in Proceedings of the International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 180-183 (1982), which is incorporated herein by reference. The pitch frequency is given by the comb frequency that maximizes the correlation of the comb function with the transformed speech signal.
A related class of schemes for pitch estimation are xe2x80x9ccepstralxe2x80x9d schemes, as described, for example, on pages 396-408 of the above-mentioned book by Hess. In this technique, a log operation is applied to the frequency spectrum of the speech signal, and the log spectrum is then transformed back to the time domain to generate the cepstral signal. The pitch frequency is the location of the first peak of the time-domain cepstral signal. This corresponds precisely to maximizing over the period T, the correlation of the log of the amplitudes corresponding to the line frequencies z(i) with cos(xcfx89(i)T). For each guess of the pitch period T, the function cos(xcfx89T) is a periodic function of xcfx89. It has peaks at frequencies corresponding to multiples of the pitch frequency 1/T. If those peaks happen to coincide with the line frequencies, then 1/T is a good candidate to be the pitch frequency, or some multiple thereof.
In another vein, a common method for time-domain pitch estimation use correlation-type schemes, which search for a pitch period T that maximizes the cross-correlation of a signal segment centered at time t and one centered at time t-T. The pitch frequency is the inverse of T. A method of this sort is described, for example, by Medan et al., in xe2x80x9cSuper Resolution Pitch Determination of Speech Signals,xe2x80x9d published in IEEE Transactions on Signal Processing 39(1), pages 41-48 (1991), which is incorporated herein by reference.
Both time- and frequency-domain methods of pitch determination are subject to instability and error, and accurate pitch determination is therefore computationally intensive. In time domain analysis, for example, a high-frequency component in the line spectrum results in the addition of an oscillatory term in the cross-correlation. This term varies rapidly with the estimated pitch period T when the frequency of the component is high. In such a case, even a slight deviation of T from the true pitch period will reduce the value of the cross-correlation substantially and may lead to rejection of a correct estimate. A high-frequency component will also add a large number of peaks to the cross-correlation, which complicate the search for the true maximum. In the frequency domain, a small error in the estimation of a candidate pitch frequency will result in a major deviation in the estimated value of any spectral component that is a large integer multiple of the candidate frequency.
An exhaustive search, with high resolution, must therefore be made over all possible candidates and their multiples in order to avoid missing the best candidate pitch for a given input spectrum. It is often necessary (dependent on the actual pitch frequency) to search the sampled spectrum up to high frequencies, above 1500 Hz. At the same time, the analysis interval, or window, must be long enough in time to capture at least several cycles of every conceivable pitch candidate in the spectrum, resulting in an additional increase in complexity. Analogously, in the time domain, the optimal pitch period T must be searched for over a wide range of times and with high resolution. The search in either case consumes substantial computing resources. The search criteria cannot be relaxed even during intervals that may be unvoiced, since an interval can be judged unvoiced only after all candidate pitch frequencies or periods have been ruled out. Although pitch values from previous frames are commonly used in guiding the search for the current value, the search cannot be limited to the neighborhood of the previous pitch. Otherwise, errors in one interval will be perpetuated in subsequent intervals, and voiced segments may be confused for unvoiced.
Various solutions have been proposed for improving the accuracy and efficiency of pitch determination. For example, McAulay et al. describe a method for tracking the line frequencies of speech signals and for reproducing the signal from these frequencies in U.S. Pat. No. 4,885,790 and in an article entitled xe2x80x9cSpeech Analysis/Synthesis Based on a Sinusoidal Representation,xe2x80x9d in IEEE Transactions on Acoustics, Speech and Signal Processing ASSP-34(4), pages 744-754 (1986). These documents are incorporated herein by reference. The authors use a sinusoidal model for the speech waveform to analyze and synthesize speech based on the amplitudes, frequencies and phases of the component sine waves in the speech signal. Any number of methods may be used to obtain the pitch values from the line frequencies. In U.S. Pat. No. 5,054,072, whose disclosure is also incorporated herein by reference, McAulay et al. describe refinements of their method. In one of these refinements, a pitch-adaptive channel encoding technique varies the channel spacing in accordance with the pitch of the speaker""s voice.
An improved method of pitch estimation is described by Hardwick et al., in U.S. Pat. Nos. 5,195,166 and 5,226,108, whose disclosures are incorporated herein by reference. An error measure between hypothesized successive time segments separated by a pitch interval is used to evaluate the quality of the pitch for integer pitch values. The criterion is refined to include neighboring signal frames to enforce pitch continuity. Pitch regions are used to reduce the amount of computation required in making the initial pitch estimate. A refinement technique is used to obtain the pitch, found earlier as an integer value, at a higher resolution of up to 1/8 of a sample point.
U.S. Pat. No. 5,870,704, to Laroche, whose disclosure is incorporated herein by reference, describes a method for estimating the time-varying spectral envelope of a time-varying signal. Local maxima of a spectrum of the signal are identified. A masking curve is applied in order to mask out spurious maxima. The masking curve has a peak at a particular maximum, and descends away therefrom. Local maxima falling below the curve are eliminated. The masking curve is subsequently adjusted according to some measure of the presence of spurious maxima. The result is supposed to be a spectrum in which only relevant maxima are present.
U.S. Pat. Nos. 5,696,873 and 5,774,836, to Bartkowiak, whose disclosures are incorporated herein by reference, are concerned with improving cross-correlation schemes for pitch value determination. It describe two methods for dealing with cases in which the First Formant, which is the lowest resonance frequency of the vocal tract, produces high energy at some integer multiple of the pitch frequency. The problem arises to a large degree because the cross-correlation interval is chosen to be equal (or close) to the pitch interval. Hypothesizing a short pitch interval may result in that hypothesis being confirmed in the form of a spurious peak of the correlation value at that point. One of the methods proposed by Bartkowiak involves increasing the window size at the beginning of a voiced segment. The other method draws conclusions from the presence or lack of all multiples of a hypothesized pitch value in the list of correlation maxima.
Other methods for improving the accuracy and efficiency of pitch estimation are described, for example, in U.S. Pat. No. 5,781,880, to Su; U.S. Pat. No. 5,806,024, to Ozawa; U.S. Pat. No. 5,794,182, to Manduchi et al.; U.S. Pat. No. 5,751,900, to Serizawa; U.S. Pat. No. 5,452,398, to Yamada et al.; U.S. Pat. No. 5,799,271, to Byun et al.; U.S. Pat. No. 5,231,692, to Tanaka et al.; and U.S. Pat. No. 5,884,253, to Kleijn. The disclosures of these patents are incorporated herein by reference.
It is an object of the present invention to provide improved methods and apparatus for determining the pitch of an audio signal, and particularly of a speech signal.
It is a further object of some aspects of the present invention to provide an efficient method for exhaustive pitch determination with high resolution. Because any pitch quality measure may have very narrow peaks as a function of the pitch frequency value, evaluating the measure with insufficient resolution may result in misestimating the location of a peak by a small amount. In this case, the pitch quality measure will be sampled slightly away from the peak, resulting in a low estimated value for the peak, when a precise evaluation would have yielded a high value for that peak. As a result, the true pitch may be discarded altogether from the list of pitch candidates. Prior art schemes which start off with a search for a pitch integer value and then refine the resulting list of pitch values all suffer from this very serious flaw. Thus, only exhaustive, high-resolution pitch frequency evaluation, as provided by preferred embodiments of the present invention, guarantees that the true pitch will be included in the list of tested pitch values.
In preferred embodiments of the present invention, a speech analysis system determines the pitch of a speech signal by analyzing the line spectrum of the signal over multiple time intervals simultaneously. A short-interval spectrum, useful particularly for finding high-frequency spectral components, is calculated from a windowed Fourier transform of the current frame of the signal. One or more longer-interval spectra, useful for lower-frequency components, are found by combining the windowed Fourier transform of the current frame with those of one or more previous frames. In this manner, pitch estimates over a wide range of frequencies are derived using optimized analysis intervals with minimal added computational burden on the system. The best pitch candidate is selected from among the various frequency ranges. The system is thus able to satisfy the conflicting objectives of high resolution and high computational efficiency.
In some preferred embodiments of the present invention, a utility function is computed in order to measure efficiently the extent to which any particular candidate pitch frequency is compatible with the line spectrum under analysis. The utility function is built up as a superposition of influence functions calculated for each significant line in the spectrum. The influence functions are preferably periodic in the ratio of the respective line frequency to the candidate pitch frequency, with maxima around pitch frequencies that are integer dividends of the line frequency and minima, most preferably zeroes, in between. Preferably, the influence functions are piecewise linear, so that they can be represented simply and efficiently by their break point values, with the values between the break points determined by interpolation. Thus, in place of the cosine function used in cepstral pitch estimation methods, these embodiments of the present invention provide another, much simpler periodic function and use the special structure of that function to enhance the efficiency of finding the pitch. The log of the amplitudes used in cepstral methods is replaced in embodiments of the present invention by the amplitudes themselves, although substantially any function of the amplitudes may be used with the same gains in efficiency.
The influence functions are applied to the lines in the spectrum in succession, preferably in descending order of amplitude, in order to quickly find the full range of candidate pitch frequencies that are compatible with the lines. After each iteration, incompatible pitch frequency intervals are pruned out, so that the succeeding iterations are performed on ever smaller ranges of candidate pitch frequencies. In this way, the compatible candidate frequency intervals can be evaluated exhaustively without undue computational burden. The pruning is particularly important in the high-frequency range of the spectrum, in which high-resolution computation is required for accurate pitch determination.
The utility function, operating on the line spectrum, is thus used to determine a utility value for each candidate pitch frequency in the search range based on the line spectrum of the current frame of the audio signal. The utility value for each candidate is indicative of the likelihood that it is the correct pitch. The estimated pitch frequency for the frame is therefore chosen from among the maxima of the utility function, with preference given generally to the strongest maximum. In choosing the estimated pitch, the maxima are preferably weighted by frequency, as well, with preference given to higher pitch frequencies. The utility value of the final pitch estimate is preferably used, as well, in deciding whether the current frame is voiced or unvoiced.
The present invention is particularly useful in low-bit-rate encoding and reconstruction of digitized speech, wherein the pitch and voiced/unvoiced decision for the current frame are encoded and transmitted along with features of the modulation of the frame. Preferred methods for such coding and reconstruction are described in U.S. patent application Ser. Nos.09/410,085 and 09/432,081, which are assigned to the assignee of the present patent application, and whose disclosures are incorporated herein by reference. Alternatively, the methods and systems described herein may be used in conjunction with other methods of speech encoding and reconstruction, as well as for pitch determination in other types of audio processing systems.
There is therefore provided, in accordance with a preferred embodiment of the present invention, a method for estimating a pitch frequency of an audio signal, including:
computing a first transform of the signal to a frequency domain over a first time interval;
computing a second transform of the signal to the frequency domain over a second time interval, which contains the first time interval; and
estimating the pitch frequency of the speech signal responsive to the first and second transforms.
Preferably, the first and second transforms include Short Time Fourier Transforms. Further preferably, the first time interval includes a current frame of the speech signal, and the second time interval includes the current frame and a preceding frame, and computing the second transform includes combining the first transform with a transform computed over the preceding frame. Most preferably, the transforms generate respective spectral coefficients, and combining the first transform with the transform computed over the preceding frame includes applying a phase shift, proportional to the frequency and to a duration of the frame, to the coefficients generated by the transform computed over the preceding frame and adding the phase-shifted coefficients to the coefficients generated by the first transform.
Additionally or alternatively, estimating the pitch frequency includes deriving first and second line spectra of the signal from the first and second transforms, respectively, and determining the pitch frequency based on the line spectra. Preferably, determining the pitch frequency includes deriving first and second candidate pitch frequencies from the first and second line spectra, respectively, and choosing one of the first and second candidates as the pitch frequency. Most preferably, deriving the first and second candidates includes defining high and low ranges of possible pitch frequencies, and finding the first candidate in the high range and the second candidate in the low range.
Preferably, the audio signal includes a speech signal, and including encoding the speech signal responsive to the estimated pitch frequency.
There is also provided, in accordance with a preferred embodiment of the present invention, a method for estimating a pitch frequency of a speech signal, including:
finding a line spectrum of the signal, the spectrum including spectral lines having respective line amplitudes and line frequencies;
computing a utility function that is periodic in the frequencies of the lines in the spectrum, which function is indicative, for each candidate pitch frequency in a given pitch frequency range, of a compatibility of the spectrum with the candidate pitch frequency; and
estimating the pitch frequency of the speech signal responsive to the utility function.
Preferably, computing the utility function includes computing at least one influence function that is periodic in a ratio of the frequency of one of the spectral lines to the candidate pitch frequency. Further preferably, computing the at least one influence function includes computing a function of the ratio having maxima at integer values of the ratio and minima therebetween. Most preferably, computing the function of the ratio includes computing values of a piecewise linear function c(f), having a maximum value in a first interval surrounding f=0, a minimum value in a second interval surrounding f=1/2, and a value that varies linearly in a transition interval between the first and second intervals.
Alternatively or additionally, computing the at least one influence function includes computing respective influence functions for multiple lines in the spectrum, and computing the utility function includes computing a superposition of the influence functions. Preferably, the respective influence functions include piecewise linear functions having break points, and computing the superposition includes calculating values of the influence functions at the break points, such that the utility function is determined by interpolation between the break points. Most preferably, computing the respective influence functions includes computing at least first and second influence functions for first and second lines in the spectrum in succession, and computing the utility function includes computing a partial utility function including the first influence function and then adding the second influence function to the partial utility function by calculating the values of the second influence function at the break points of the partial utility function and calculating the values of the partial utility function at the break points of the second influence function.
In a preferred embodiment, computing the respective influence functions includes performing the following steps iteratively over the lines in the spectrum:
computing a first influence function for a first line in the spectrum;
responsive to the first influence function, identifying one or more intervals in the pitch frequency range that are incompatible with the spectrum;
defining a reduced pitch frequency range from which the one or more intervals have been eliminated; and
computing a second influence function for a second line in the spectrum, while substantially restricting computation of the second influence to pitch frequencies within the reduced range.
Preferably, computing the superposition includes calculating a partial utility function including the first influence function but not including the second influence function, and identifying the one or more intervals includes eliminating the intervals in which the partial utility function is below a specified level. Most preferably, the specified level is determined responsive to the line amplitudes of the lines in the spectrum that are not included in the partial utility function. Additionally or alternatively, performing the steps iteratively includes iterating over the lines in the spectrum in order of decreasing amplitude.
Preferably, estimating the pitch frequency includes choosing a candidate pitch frequency at which the utility function has a local maximum. Typically, the chosen pitch frequency is one of a plurality of frequencies at which the utility function has local maxima, and choosing the candidate pitch frequency includes preferentially selecting one of the maxima because it has a higher frequency than another one of the maxima. Additionally or alternatively, choosing the candidate pitch frequency includes preferentially selecting one of the maxima because it is near in frequency to a previously-estimated pitch frequency of a preceding frame of the speech signal.
In a preferred embodiment, the method includes determining whether the speech signal is voiced or unvoiced by comparing a value of the local maximum to a predetermined threshold.
There is additionally provided, in accordance with a preferred embodiment of the present invention, apparatus for estimating a pitch frequency of an audio signal, including an audio processor, which is adapted to compute a first transform of the signal to a frequency domain over a first time interval and a second transform of the signal to a frequency domain over a second time interval, which contains the first time interval, and to estimate the pitch frequency of the speech signal responsive to the first and second frequency transforms.
There is further provided, in accordance with a preferred embodiment of the present invention, apparatus for estimating a pitch frequency of an audio signal, including an audio processor, which is adapted to find a line spectrum of the signal, the spectrum including spectral lines having respective line amplitudes and line frequencies, to compute a utility function that is periodic in the frequencies of the lines in the spectrum, which function is indicative, for each candidate pitch frequency in a given pitch frequency range, of a compatibility of the spectrum with the candidate pitch frequency, and to estimate the pitch frequency of the speech signal responsive to the periodic function.
There is moreover provided, in accordance with a preferred embodiment of the present invention, a computer software product, including a computer-readable storage medium in which program instructions are stored, which instructions, when read by a computer receiving an audio signal, cause the computer to compute a first transform of the signal to a frequency domain over a first time interval and a second transform of the signal over a second time interval to the frequency domain, which contains the first time interval, and to estimate the pitch frequency of the speech signal responsive to the first and second transforms.
There is furthermore provided, in accordance with a preferred embodiment of the present invention, a computer software product, including a computer-readable storage medium in which program instructions are stored, which instructions, when read by a computer receiving an audio signal, cause the computer to find a line spectrum of the signal, the spectrum including spectral lines having respective line amplitudes and line frequencies, to compute a utility function that is periodic in the frequencies of the lines in the spectrum, which function is indicative, for each candidate pitch frequency in a given pitch frequency range, of a compatibility of the spectrum with the candidate pitch frequency, and to estimate the pitch frequency of the speech signal responsive to the periodic function.